﻿<?php

if(isset($_REQUEST['id']) == true)
{
    $MaDDH = $_REQUEST['id'];
    include_once("./template/DataProvider.php");
    $query=" SELECT * FROM chitietddh WHERE MaDDH = '".$MaDDH."'";
    $result=DataProvider::executeQuery($query);
    $row = mysql_fetch_array($result);
    
    if($row['DaThanhToan'] == '1' )
    {
        $query1 = "UPDATE chitietddh SET DaThanhToan=0 WHERE MaDDH = '".$row['MaDDH']."'";
        $result1=DataProvider::executeQuery($query1);
    }
    else
    {
        $query2 = "UPDATE chitietddh SET DaThanhToan=1  WHERE MaDDH = '".$row['MaDDH']."'";
        $result2=DataProvider::executeQuery($query2);
    }
    echo '<script type="text/javascript">';
    echo 'location="trangchu.php?act=9"';
    echo '</script>';
}
else
{
    echo '<script type="text/javascript">';
    echo 'location="trangchu.php?act=9"';
    echo '</script>';
}
?>